package strengthen.spatial;

import java.awt.image.Raster;
import java.awt.image.WritableRaster;

import core.Filter;

public class SpatialFilter extends Filter {

	private IFilterMask mask;
	private Raster raster;

	public SpatialFilter(IFilterMask mask) {
		this.mask = mask;
	}

	@Override
	public void process(Raster source, WritableRaster dest) {
		raster = source;
		super.process(source, dest);
	}

	@Override
	public int[] processPixel(int[] pixel, int x, int y) {

		mask.calculatePixel(pixel, x, y, raster);

		return pixel;
	}

}
